USE [Training]
GO

IF NOT EXISTS (SELECT * from dbo.sysobjects WHERE id = OBJECT_ID(N'dbo.training_api_SkillSetItemsSelect'))
	EXEC('CREATE PROC dbo.training_api_SkillSetItemsSelect AS')
GO

ALTER PROC dbo.training_api_SkillSetItemsSelect
	@SkillSetID		int
AS
	SELECT
		sk.SkillID,
		sk.Title,
		sk.DocID,
		sks.RetrainFrequency
	FROM
		Skill sk
		JOIN Skill_SkillSet sks ON sk.SkillID = sks.SkillID
		JOIN SkillSet ss ON sks.SkillSetID = ss.SkillSetID
			AND sks.SkillSetID = @SkillSetID
	
